package unitTests;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.util.List;

import org.junit.Before;
import org.junit.Test;

import datamodels.Manuscript;
import datamodels.Review;
/**
 * A frame for assigning a reviewer to a manuscript.
 * @author Zach Turk
 *
 */
public class TestManuscript {

	private Manuscript manuscript;
	private Review review;
	
	@Before
	public void setUp() throws Exception {
		manuscript = new Manuscript();
		review = new Review("author", "text");
	}

	@Test
	public void testAddReview() {
		//check to see if a review is already associated with this manuscript.
		List<Review> reviews = manuscript.getReviews();
		assertFalse(reviews.contains(review));
		
		//check to see if we are able to add a review to this manuscript.
		manuscript.addReview(review);
		reviews = manuscript.getReviews();
		assertTrue(reviews.contains(review));
		
		//check to see that we only added one review to this manuscript.
		reviews.remove(review);
		assertFalse(reviews.contains(review));
	}

}
